package lab03.test04;

import java.io.*;

/**
 * Created by 星月 on 2017/12/01.
 */
public class Test {
    public static void main(String[] args) throws IOException {
        String source="F:\\java实验三\\source\\high.mp3";
        String target="F:\\java实验三\\target\\";
        BufferedWriter writer=null;
        BufferedReader reader=null;
        try {
            reader=new BufferedReader(new FileReader(source));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            File file = new File(target);
            if (!file.exists()) file.mkdir();
            writer = new BufferedWriter(new FileWriter("F:\\java实验三\\target\\high.mp3"));
            writer.write(reader.read());
            for (File f : file.listFiles()) {
                if (f.isFile()) {
                    System.out.println("文件：" + f.getName());
                }
            }
        }finally {
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

